<script setup lang="ts">
import {onMounted} from "vue";
import useUserStore from "@/stores/modules/user.ts";
import {getTime} from "@/utils/time.ts";

const userStore = useUserStore()

const {userInfo} = userStore

onMounted(() => {
  userInfo()
})
</script>

<template>
  <el-card>
    <div class="box">
      <img :src="userStore.avatar" alt="" class="avatar">
      <div class="bottom">
        <h3 class="title">{{ getTime() }}好{{ userStore.username }}</h3>
        <p class="subtitle">Backstage Management System</p>
      </div>
    </div>
  </el-card>
</template>

<style scoped lang="scss">
.box {
  display: flex;

  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }

  .bottom {
    margin-left: 20px;
    margin-top: 10px;
    .title {
      font-size: 30px;
      font-weight: 900;
      margin-bottom: 20px;
    }

    .subtitle {
      font-style: italic;
      color: skyblue;
    }
  }
}
</style>